<template>
  <div class="head">
    <div class="weather">
      <div class="w-item">
        <!-- <weather /> -->
      </div>
      <div class="w-item">
        <!-- <weather /> -->
      </div>
    </div>
    <div class="title">
      上体运动健康促进中心
    </div>
    <div class="datetime">{{ realtime }}</div>
  </div>
</template>

<script>
import Weather from "./weather";
import moment from "moment";

let timer = null;

export default {
  components: {
    Weather
  },
  data() {
    return {
      realtime: moment().format("YYYY年MM月DD日 HH:mm:ss")
    };
  },
  mounted() {
    timer = setInterval(() => {
      this.realtime = moment().format("YYYY年MM月DD日 HH:mm:ss");
    }, 1000);
  },
  beforeDestroy() {
    clearInterval(timer);
  }
};
</script>

<style lang="scss" scoped>
.head {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  .weather {
    display: flex;
    align-items: center;
    width: 340px;
    .w-item {
      margin-right: 30px;
    }
  }
  .title {
    font-size: 52px;
    font-weight: 500;
    width: 800px;
    height: 73px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    &::after,
    &::before {
      content: " ";
      display: block;
      height: 48px;
      width: 84px;
      background: url(../../assets/dashboard/title-l.png) no-repeat center
        center/100% 100%;
    }
    &::after {
      background: url(../../assets/dashboard/title-r.png) no-repeat center
        center/100% 100%;
    }
  }
  .datetime {
    width: 340px;
    font-size: 28px;
    opacity: 0.75;
    text-align: right;
  }
}
</style>
